package com.peng.web;

import com.google.common.collect.ImmutableSet;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ApiController
 *
 * @author lupeng
 * Created on 2022-04-30
 */
@RestController
@RequestMapping("/api")
public class ApiController {

    private static final Logger logger = LoggerFactory.getLogger(ApiController.class);

    @Resource
    private AopTextService aopTextService;

    @GetMapping("/hello")
    public Map<String, Object> hello(String name) {
        logger.info("name is {}", name);
        Map<String, Object> result = new HashMap<>();
        aopTextService.getPerson(11, ImmutableSet.of("aa", "bb"), AopTextService.Type.A);
        result.put("msg", "hello" + name);
        return result;
    }
}
